<?
class Route
{
	private $c = null;
	
	private $a = null;
	
	public function __construct()
	{
		global $G;
		
        $this->urlRewrite();
        
		$this->excController();
	}
	
	private function urlRewrite()
	{
		if(url_rewrite)
        {
            
        }
        else
        {
            if(empty($_GET['action']))
            {
                $this->c = 'Index';
                $this->a = 'index';
            }
            else
            {
                $get_A = explode('-', $_GET['action']);
                
                $this->c = $get_A[0];
                $this->a = empty($get_A[1]) ? 'index' : $get_A[1];
            }
        }
	}
    
	private function excController()
	{
        $ctrl = 'Controller_' . application_name . '_' . $this->c;

        $Controller = new $ctrl();

        $Action = $this->a;

        $Controller->$Action();
	}
}
?>